<script type="text/javascript">
<?php if ($section == "proj_deliv") { ?>
$(document).ready(function() {
	// validate signup form on keyup and submit
	
	var validator = $("#form1").validate({
		rules: {
			mid: "required",
			pd_name: "required",
			del_num: "required",
			pd_desc1: "required",
			pd_desc2: "required",
			pd_desc3: "required",
			pd_desc4: "required",
			pd_desc5: "required"
		},
		messages: {
			mid: "Please choose an applicable module.",
			pd_name: "Please enter a deliverable name.",
			del_num: "Please choose a delivarable number.",
			pd_desc1: "Please enter a key deliverable description.",
			pd_desc2: "Please enter a what the student needs to know to complete the assignment.",
			pd_desc3: "Please enter the major focus of module as it relates to the this project deliverable.",
			pd_desc4: "Please enter a description of the supporting reading information.",
			pd_desc5: "Please enter what students will be discussing in the forum.",
		},
		
	});

});
<?php } ?>

<?php if ($section == "clo") { ?>
$(document).ready(function() {
	// validate signup form on keyup and submit
	
	var validator = $("#form1").validate({
		rules: {
			lo_text: "required",
		},
		messages: {
			lo_text: "Please enter the learning outcome.",
		},
		
	});

});
<?php } ?>

<?php if ($section == "proposal_titles") { ?>
$(document).ready(function() {
	// validate signup form on keyup and submit
	
	var validator = $("#form1").validate({
		rules: {
			module_title:  "required",
			module_overview: "required",
			<?php 
			$query_themes = sprintf("SELECT * FROM themes WHERE cid='%s' AND mid='%s' ORDER BY theme_num ASC", $cid, $row_modules['mid']);
			$themes = mysql_query($query_themes, $connection) or die(mysql_error());
			$row_themes = mysql_fetch_assoc($themes);
			do { ?>
			theme_title<?php echo $row_themes['id']; ?>: "required",
			<?php } while ($row_themes = mysql_fetch_assoc($themes)); ?>
			<?php
			$query_assignments = sprintf("SELECT * FROM assignments WHERE cid='%s' AND mid='%s' ORDER BY assign_num ASC", $cid, $row_modules['mid']);
			$assignments = mysql_query($query_assignments, $connection) or die(mysql_error());
			$row_assignments = mysql_fetch_assoc($assignments);
			do { ?>
			assign_title<?php echo $row_assignments['id']; ?>: "required",
			<?php } while ($row_assignments = mysql_fetch_assoc($assignments)); ?>
		},
		messages: {
			module_title: "Please enter the module's title.",
			module_overview: "Please enter the module overview.",
			<?php 
			$query_themes = sprintf("SELECT * FROM themes WHERE cid='%s' AND mid='%s' ORDER BY theme_num ASC", $cid, $row_modules['mid']);
			$themes = mysql_query($query_themes, $connection) or die(mysql_error());
			$row_themes = mysql_fetch_assoc($themes);
			do { ?>
			theme_title<?php echo $row_themes['id']; ?>: "Please enter a title for this theme.",
			<?php } while ($row_themes = mysql_fetch_assoc($themes)); ?>
			<?php
			$query_assignments = sprintf("SELECT * FROM assignments WHERE cid='%s' AND mid='%s' ORDER BY assign_num ASC", $cid, $row_modules['mid']);
			$assignments = mysql_query($query_assignments, $connection) or die(mysql_error());
			$row_assignments = mysql_fetch_assoc($assignments);
			do { ?>
			assign_title<?php echo $row_assignments['id']; ?>: "Please enter a title for this assignment.",
			<?php } while ($row_assignments = mysql_fetch_assoc($assignments)); ?>
		},
		
	});

});
<?php } ?>

<?php if ($section == "proposal_materials") { ?>
$(document).ready(function() {
	// validate signup form on keyup and submit
	
	var validator = $("#form1").validate({
		rules: {
			matType: "required",
			matTitle: "required",
			matAuthor: "required",
			matYear: "required",
			matPublisher: "required",
			matCity: "required",
			matInfo: "required",
		},
		messages: {
			matType: "Please choose a material type.",
			matTitle: "Please enter the title of the work.",
			matAuthor: "Please enter the author(s).",
			matYear: "Please enter the year of publication.",
			matPublisher: "Please enter publisher/journal name.",
			matCity: "Please enter city and state/provice.",
			matInfo: "Please enter your reasons for choosing this particular work"
		},
		
	});

});
<?php } ?>

<?php if ($section == "module_theme") { ?>
$(document).ready(function() {
	// validate signup form on keyup and submit
	
	var validator = $("#form1").validate({
		rules: {
			theme_title: "required",
		},
		messages: {
			theme_title: "Please enter a theme title.",
		},
		
	});

});
<?php } ?>

<?php if ($section == "module_assignment") { ?>
$(document).ready(function() {
	// validate signup form on keyup and submit
	
	var validator = $("#form1").validate({
		rules: {
			assign_title: "required",
			assign_points: "required",
		},
		messages: {
			assign_title: "Please enter an assignment title.",
			assign_points: "Please enter the points possible for the assignment.",
		},
		
	});

});
<?php } ?>


<?php if ($section == "ce") { ?>

<?php } ?>
</script>
